bitkeeper revision 1.1178 (420c87ccD2VdHFZVGUqHR4Zd2yI1mg)
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 11 Feb 2005 10:24:12 +0000 (10:24 +0000)
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 11 Feb 2005 10:24:12 +0000 (10:24 +0000)
After a fatal trap, we want to debug whatever caused the trap rather than the trap
handler.  Fix things up accordingly.

Also add some documentation while I'm here.

Signed-off-by: sos22@cl.cam.ac.uk.
xen/arch/x86/traps.c
xen/include/asm-x86/debugger.h

index 53ff190ea82b21dbe903790f128c61412066765a..12f2f1772b37e8e1b77685a58f7bcabf18788674 100644 (file)
@@ -123,7 +123,7 @@ asmlinkage void fatal_trap(int trapnr, struct xen_regs *regs)
     printk("System shutting down -- need manual reset.\n");
     printk("************************************\n");
 
-    debugger_trap_immediate();
+    debugger_trap_fatal(trapnr, regs);
 
     /* Lock up the console to prevent spurious output from other CPUs. */
     console_force_lock();
index dc018f5bdb4977025ea519cfbb0031430ed94dd0..62828329b8ccefabb5535ef9d60ec7115bd9b959 100644 (file)
  *  hook to drop into a debug session. It can also be used to hook off
  *  deliberately caused traps (which you then handle and return non-zero)
  *  but really these should be hooked off 'debugger_trap_entry'.
+ *
+ * 3. debugger_trap_immediate():
+ *  Called if we want to drop into a debugger now.  This is essentially the
+ *  same as debugger_trap_fatal, except that we use the current register state
+ *  rather than the state which was in effect when we took the trap.
+ *  Essentially, if we're dying because of an unhandled exception, we call
+ *  debugger_trap_fatal; if we're dying because of a panic() we call
+ *  debugger_trap_immediate().
  */
 
 #ifndef __X86_DEBUGGER_H__